#include "Actor3DEvent.hpp"
#include "Actor3D.hpp"
#include <QxtLogger>
Actor3DEvent::Actor3DEvent(Actor3D *who,const QByteArray &dimension,const QByteArray &scale,const QByteArray &derivative, float v, float t){
    actor = who;
    key = dimension +"-"+scale+"-"+derivative;
    value = v;
    myTime = t;
}

Actor3DEvent::Actor3DEvent(Actor3D *who,const QByteArray &shortKey, float v, float t) {
    actor = who;
    key = shortKey;
    value = v;
    myTime = t;
}

void Actor3DEvent::dispatch() {
    if(actor) {
        if( Actor3D::keyValid(key) )
            qxtLog->trace() << "Dispatching Event: " + key + " "+ QByteArray::number(value);
            actor->getF(key) = value;
            qxtLog->trace() << "New value: " + QByteArray::number(actor->getF(key));
    }
}
